//
//  MainViewController.m
//  TestMenu
//
//  Created by apple on 13-10-10.
//  Copyright (c) 2013年 apple. All rights reserved.
//
//helloerere
#import "MainViewController.h"
#import "Cell.h"
#define INPUT_HEIGHT 44
@interface MainViewController ()

@end

@implementation MainViewController

@synthesize tableView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
- (BOOL)resignFirstResponder
{
    UITextView *txtView=(UITextView *)[self.view viewWithTag:11];
    [txtView resignFirstResponder];
    return [super  resignFirstResponder];
}
- (void)viewDidLoad
{
    self.edgesForExtendedLayout=UIRectEdgeNone;
    self.tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 200) style:UITableViewStylePlain];
    [self.tableView setDelegate:self];
    [self.tableView setDataSource:self];
    [self.view addSubview:self.tableView];
    
    
    
    
    CGRect inputFrame = CGRectMake(0.0f, self.view.frame.size.height- INPUT_HEIGHT-200, 320, INPUT_HEIGHT);
    self.inputView = [[UIImageView alloc] initWithFrame:inputFrame];
    self.inputView.opaque=YES;
    [self.inputView setUserInteractionEnabled:YES];
    [self.inputView setBackgroundColor:[UIColor redColor]];
    self.inputView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin);
    UITextView *txtView=[[UITextView alloc] initWithFrame:CGRectMake(0, 20, 320, 120)];
    [txtView setTag:11];
    [self.inputView addSubview:txtView];
    [txtView setDelegate:self];
    
    [txtView setBackgroundColor:[UIColor blueColor]];
    [txtView setText:@"hello"];
    [self.view addSubview:self.inputView];
    [txtView setDelegate:self];
    
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 13;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *identifier=@"identifier";
    Cell *cell_1=(Cell *)[tableView dequeueReusableCellWithIdentifier:identifier];
    if (!cell_1) {
        cell_1=[[Cell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    cell_1.labName.text=@"hello";
    return cell_1;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
